import { createHashRouter, Navigate } from 'react-router-dom';
import EthersPage from '@/view/EthersPage';
import EIndex from '@/view/ethers/index';
import ViemPage from '@/view/ViemPage';
import Layout from '@/components/layout';
import AntDesignWeb3 from '@/view/AntDesignWeb3';
import ReduxExample from '../components/ReduxExample';
import ConnectWallet from '@/view/connectWallet/index';

const routers = createHashRouter([
  {
    path: '/home',
    element: <Layout />,
    children: [
      {
        index: true,
        element: <Navigate to='/ethers' />,
      },
      {
        path: '/home/ethers',
        element: <EthersPage />,
      },
      {
        path: '/home/ethers-index',
        element: <EIndex />,
      },
      {
        path: '/home/viem',
        element: <ViemPage />,
      },
      {
        path: '/home/antDesignWeb3',
        element: <AntDesignWeb3 />,
      },
      {
        path: '/home/redux-example',
        element: <ReduxExample />,
      }
    ],
  },
  // 添加路由不成功
  {
    path: '/connect-index',
    element: <ConnectWallet />,
  }
]);

export default routers;